fix(relay): preserve multi-channel workflow queries#2350
Draft
JayFarei wants to merge 2 commits into
Draft
Conversation
Avoid pushing a single channel predicate when a Nostr filter contains multiple #h values, so batched Desktop workflow listings retain every accessible channel. Co-authored-by: jayfarei <fareiunastrage@gmail.com> Signed-off-by: jayfarei <fareiunastrage@gmail.com>
Intersect explicit multi-channel filters with the caller's accessible channels before SQL LIMIT so unrelated channel rows cannot hide requested workflows. Co-authored-by: jayfarei <fareiunastrage@gmail.com> Signed-off-by: jayfarei <fareiunastrage@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
#hfilter into a single channel predicate.Why
Desktop batches the Workflows overview into one Nostr filter containing every member channel. The HTTP relay bridge previously selected one
#hvalue for SQL pushdown, so workflows in every other requested channel were filtered out. A broad fallback alone was also insufficient because unrelated accessible-channel rows could consume the query limit before requested rows reached Nostr post-filtering.This made valid workflows invisible in Desktop even though direct single-channel workflow queries could retrieve them.
User impact
The Workflows overview can list workflows across all accessible channels in one request, including workflows created by agents in DMs. Single-channel queries keep their existing fast path.
Validation
cargo fmt --all -- --checkcargo clippy -p buzz-relay --all-targets -- -D warningscargo test -p buzz-relay --lib -- --skip api::mesh_demo::tests::demo_join_forwarded_arm_round_trips_echo— 717 passed, 23 ignored, 1 filtered out./scripts/check-branch-skew.shThe unfiltered relay package run had one unrelated existing failure:
api::mesh_demo::tests::demo_join_forwarded_arm_round_trips_echoreturned 504 instead of 200. All changed request-filter tests passed.